Sum of the first N positive integersΒΆ

Write a python program to sum of the first n positive integers.
n = int(input("Input a number: "))
sum_num = (n * (n + 1)) / 2

print(sum_num)

Output:

Input a number: 2
3.0